package com.inspur.icity.bus.api.user.enumeration;

/**
 * 系统代码配置
 * Created by SOA on 2018/2/2.
 */
public enum AreaCodeEnum {
    A("济南市","90"), B("乌海市","01"), C("石家庄市","02"), D("滨州市","03");

    /*
    区域名称
     */
    private String name;
    /*
    区域代码
     */
    private String code;

    private AreaCodeEnum(String name,String code){
        this.name = name;
        this.code = code;
    }

    /**
     * 获取区域代码
     * @param name
     * @return
     */
    public static String getAreaCode(String name){
        for(AreaCodeEnum areaCodeEnum : AreaCodeEnum.values()){
            if(name.equals(areaCodeEnum.getName())){
                return areaCodeEnum.getCode();
            }
        }
        return null;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getCode() {
        return code;
    }

    public void setCode(String code) {
        this.code = code;
    }
}